 <{extends file="<{$tempdir}>/public/admin.html"}> 
   <{block name=extendjs}>
<script type="text/javascript" language="javascript" src="<{$siteurl}>/templates/<{$tempdir}>/public/js/artdialog/plugins/iframeTools.js"></script>
 <{/block}>
 <{block name=controlname}>城市列表<{/block}>
 <{block name=bodylist}>

   <div style="width:98%;overflow-y:auto;white-space:nowrap;"> 
           <div class="tags"> 
          <div id="tagscontent"> 
            <div id="con_one_1"> 
              <div class="table_td" style="margin-top:10px;"> 
              <form method="post" action="" onsubmit="return remind();"> 
                  <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%"> 
                    <thead> 
                      <tr> 
                        <th align="center">名称</th>  
                        <th align="center">所属分站名称</th>  
                        <th align="center">首个字母</th> 
                        <th align="center">排序ID</th>   
                        <th align="center">操作</th> 
                      </tr> 
                    </thead>  
                     <tbody>
                     	   
                            
                    
                   <{if empty($citylist)}> 	
                     	 <tr class="s_out" onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff"  >  
							暂无数据
						  </tr>
                   <{else}>
                         
                        	<{foreach from=$citylist item=items}>
                     	  <tr class="s_out" onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff" id="tr_<{$items['id']}>">  
                              <td align="center">
                               	  	<{$items['name']}> 
                               </td> 
							   <td align="center"> 
							   <{load_data assign="stationinfo" table="stationadmininfo" type="one" where="cityid='<{$items['adcode']}>'" fileds="stationname" }>  
                               	  	<{$stationinfo['stationname']}> 
                               </td> 
                              <td align="center"> <{$items['pin']}> </td>  
                              <td align="center"><{$items['orderid']}></td>    
                              <td align="center">
							  <a href="<{ofunc type=url link="/adminpage/station/module/managecity/id/<{$items['id']}>"}>"><img src="<{$siteurl}>/templates/<{$tempdir}>/public/images/admin/edit.jpg"></a>
                               <a onclick="return remind(this);" href="<{ofunc type=url link="/adminpage/station/module/delcity/id/<{$items['id']}>/datatype/json"}>"><img src="<{$siteurl}>/templates/<{$tempdir}>/public/images/admin/del.jpg"></a>
							   </td> 
                        </tr>
                    <{/foreach}>  
                     	
                   <{/if}>
                    

                    </tbody> 

                  </table>

                <div class="blank20"></div> 

                </form>

                 
                <div class="blank20"></div>

              </div>

            </div>

          </div>

        </div>

        
  </div>
  <script> 
  	 
 </script>
 
</div> 
<script>
	function dosetarea(obj){
		 var panduan = $(obj).attr('checked');
	   var areaid = $(obj).attr('data');
	   if(panduan == true){
	   	var backmes = doupdata({'areaid':areaid,'type':'add'});
	   	if(backmes == true){
	   	 $('#showno_'+areaid).hide();
	   	 $('#showyes_'+areaid).show();
	   	}
	   	$(obj).attr('checked',false);
	   }else{
	   	var backmes = doupdata({'areaid':areaid,'type':'del'});
	   	if(backmes == true){
	   	  $('#showno_'+areaid).show();
	   	  $('#showyes_'+areaid).hide();
	   	}
	   	$(obj).attr('checked',true);
	   }
	}
	function doupsetarea(obj){
		 var areaid = $(obj).attr('data');
		doupdata({'areaid':areaid,'type':'updat','cost':$(obj).val()});
	}
	function doupdata(datas){
		var getinfo = true;
   	$.ajax({
     type: 'post',
     async:false,
     data:datas,
     url: '<{ofunc type=url link="/adminpage/area/module/adminareacost/datatype/json"}>', 
     dataType: 'json',success: function(content) {   
     	if(content.error == false){
     		artsucces('更新成功');
     	}else{
     		 getinfo = false;
     		if(content.error == true)
     		{
     			diaerror(content.msg); 
     		}else{
     			diaerror(content); 
     		}
     	} 
		},
    error: function(content) { 
    	getinfo = false;
    	diaerror('提交数据失败'); 
	    }
    });  
    return getinfo;
  } 
  	var mydialog;
	function biaoji(areaid){
    	mydialog = art.dialog.open(siteurl+'/index.php?ctrl=adminpage&action=area&module=baidumap&id='+areaid,{height:'550px',width:'850px'},false);
    	//http://www.hanwoba.com/index.php?ctrl=admin&action=baidumap&id=2#
	 	  mydialog.title('设置标记百度地址位置'); 
  }
 function closemydilog(){
    	mydialog.close();
 }
 function doshowmap(obj){
 	var types = 2;
 	if($(obj).attr("checked")==true)types = 1; 
  $.ajax({
     type: 'post',
     async:false,
     data:{'id':$(obj).attr('data'),'type':types},
     url: '<{ofunc type=url link="/adminpage/area/module/setshow/datatype/json"}>', 
     dataType: 'json',success: function(content) {   
     	if(content.error == false){
     		artsucces('更新成功');
     	}else{ 
     		if(content.error == true)
     		{
     			diaerror(content.msg); 
     		}else{
     			diaerror(content); 
     		}
     	} 
		},
    error: function(content) {  
    	diaerror('提交数据失败'); 
	    }
    });
  
 }
 
 
function setadmin(areaname,adminid,areaid)
{
	 
  var	htmls = '<form method="post" id="subyj" action="#" style="text-align:center;"><table>';
	htmls += '<tbody><tr>';
	htmls += '<td height="50px">选择所属管理员:</td>';
	htmls += '<td> <select name="adminid"><option value="0">不设置所属管理员</option>';
	<{foreach from=$adminall item=items}>
	if(adminid == <{$items['uid']}>){
		htmls += '<option value="<{$items['uid']}>" selected><{$items['username']}></option>';
	}else{
		htmls += '<option value="<{$items['uid']}>"><{$items['username']}></option>';
	} 
	<{/foreach}>
	
	htmls += '</td></tr></tbody></table> ';
  htmls += '<input type="hidden" value="'+areaid+'" name="areaid"> ';
	htmls += '<input type="button" value="确认提交" class="button" onclick="parent.buttonsubyj();" id="buttonsubyj" ></form>';
  art.dialog({
    id: 'testID4',
    title:'设置'+areaname+'区域所属管理员',
    content: htmls
  });
} 
function buttonsubyj(){
	$.post('<{ofunc type=url link="/adminpage/area/module/setareaadmin/datatype/json"}>', $('#subyj').serialize() ,function (data, textStatus){  
			if(data.error == false){
     	  	diasucces(data.msg,'');
     	}else{
     		if(data.error == true)
     		{
     			diaerror(data.msg); 
     		}else{
     			diaerror(data); 
     		}
     	} 
	 }, 'json'); 
}
</script>
<!--newmain 结束-->
<{/block}>